package com.guard.agent.plugin.springboot;

import com.guard.agent.bridge.LoggerProxy;
import org.springframework.boot.SpringApplication;

/**
 * 该类由被拦截的类的ClassLoader加载，能调用的方法有所限制
 */
public class SpringBootInterceptor {

    public void before() {
        LoggerProxy.info("hello world");
        System.out.println("before");
        System.out.println(SpringBootInterceptor.class.getClassLoader());
        System.out.println(Thread.currentThread().getContextClassLoader());

        System.out.println(SpringApplication.class.getClassLoader());

    }

    public void after() {
        System.out.println("after");

        System.out.println(SpringBootInterceptor.class.getClassLoader());
        System.out.println(Thread.currentThread().getContextClassLoader());
        System.out.println(SpringApplication.class.getClassLoader());
    }

}
